package com.sailing.xjpb.common.web;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActionResult<T> {

    /**
     * 版本号
     */
    private static final long serialVersionUID = 7339208696558286327L;

    /**
     * 返回状态码
     */
    private int responseCode;

    /**
     * 返回信息
     */
    private String message;
    /**
     * 异常简要信息
     */
    private String exception;
    /**
     * 返回路径
     */
    private String path;

    /**
     * 返回结果
     */
    private T result;

    /**
     * 判断是否请求成功
     *
     * @return
     */
    public boolean isSuccess() {
        return responseCode == ResponseCode.SUCCESS.getCode();
    }
}
